package com.project.dao.impl;

import java.util.List;

import com.project.dao.IDaoBackendUser;
import com.project.dao.bean.BackendUser;
import com.project.webapp.form.backend.LoginBackendForm;

public class DaoBackendUserImpl extends BaseDaoImpl implements IDaoBackendUser {

    @Override
    public boolean validLoginBackendUser(LoginBackendForm loginBackendForm) throws Exception {
        @SuppressWarnings("unchecked")
        List<BackendUser> list = this.getSqlMapClient().queryForList("queryBackendUserByCondition",
            loginBackendForm);
        if (list == null || list.size() == 0) {
            return false;
        } else {
            return true;
        }
    }

    @Override
    public List<BackendUser> getBackendUserList(LoginBackendForm loginBackendForm) throws Exception {
        @SuppressWarnings("unchecked")
        List<BackendUser> list = this.queryWithPg("queryBackendUserWithPg", loginBackendForm);
        return list;
    }

}
